
<template>
  <div class="editComponent">
    <el-button
      v-for="(item,index) in cActionList"
      :key="index"
      v-bind="item.config"
      @click="handleClick(item)"
    >
      {{ item.text }}
    </el-button>
  </div>
</template>

<script>
export default {
  name: 'EditComponent',
  props: {
    actionList: {
      type: Array,
      default: () => []
    },
    row: {
      type: Object,
      default: () => {}
    }
  },
  computed: {
    cActionList () {
      return this.actionList.filter(v => v.show)
    }
  },
  methods: {
    handleClick (item) {
      item.fn && item.fn(this.row)
    }
  }
}
</script>

<style>

</style>
